package jpao.benchmark;

/**
 *
 * @author soa
 */
public class StopWatch {
    
    private long startTime = System.nanoTime();
    
    public StopWatchMetric getMetric() {
        return getMetric(null);
    }
    
    public StopWatchMetric getMetric(final String label) {
        long time = System.nanoTime();
        long elapsedTime = time - startTime;
        return new StopWatchMetric(time, elapsedTime, label);
    }
}
